package com.probox.common.entity.domain.customer;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.probox.common.core.annotation.Excel;
import com.probox.common.core.enums.ReleaseShopTypeEnum;
import com.probox.common.core.utils.money.MoneyUtils;
import com.probox.common.entity.domain.platfom.PlatformStore;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * 储值信息对象 recharge_info
 *
 * @author usoft
 * @date 2022-09-14
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("recharge_info")
public class RechargeInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 储值ID
     */
    //默认主键自增
    @TableId(value = "recharge_id", type = IdType.AUTO)
    private Long rechargeId;

    /**
     * 储值名称
     */
    @Excel(name = "储值名称")
    private String rechargeName;

    /**
     * 是否推荐
     */
    @Excel(name = "是否推荐")
    private String isRecommend;

    private String isCommon;

    /**
     * 储值icon
     */
    @Excel(name = "储值icon")
    private String rechargeIcon;

    /**
     * 显示顺序
     */
    @Excel(name = "显示顺序")
    private Long rechargeSort;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 储值金额
     */
    @Excel(name = "储值金额")
    private Long rechargeMoney;


    @TableField(exist = false)
    private BigDecimal rechargeMoneyBig;

    public String getRechargeMoneyFmt(){
        return MoneyUtils.changeF2Y(rechargeMoney);
    }

    /**
     * 首充双倍(1是/0否)
     */
    @Excel(name = "首充双倍(1是/0否)")
    private String firstDouble;

    /**
     * 首充重置月份(可以重新开始计算)
     */
    @Excel(name = "首充重置月份(可以重新开始计算)")
    private Long firstDoubleMonth;

    /**
     * 获得金币
     */
    @Excel(name = "获得金币")
    private Long goldCoin;

    public String getGoldCoinFmt(){
        return MoneyUtils.changeF2Y(goldCoin);
    }

    /**
     * 获得银币
     */
    @Excel(name = "获得银币")
    private Long silverCoin;

    public String getSilverCoinFmt(){
        return MoneyUtils.changeF2Y(silverCoin);
    }

    /**
     * 获得积分
     */
    @Excel(name = "获得积分")
    private Long score;

    /**
     * 储值项描述
     */
    @Excel(name = "储值项描述")
    private String rechargeDesc;

    /**
     * 数据状态（0-无效/1-有效）
     */
    @Excel(name = "数据状态", readConverterExp = "0=-无效/1-有效")
    private String dataStatus;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private Long createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人名称
     */
    @Excel(name = "创建人名称")
    private String createName;

    /**
     * 修改人
     */
    @Excel(name = "修改人")
    private Long updateUser;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 修改时间
     */
    @Excel(name = "修改时间")
    private String updateName;

    @TableField(exist = false)
    private  String rightType;
    @TableField(exist = false)
    private  List<String> rightTypeList;
    public String getRightTypeStr(){
        return ReleaseShopTypeEnum.getNameByKey(rightType);
    }

    @TableField(exist = false)
    private Long rightObjectId;
    @TableField(exist = false)
    private List<RechargeInfoRights> rightObjectIdList;


    @TableField(exist = false)
    private List<Long> storeList;

    @TableField(exist = false)
    private List<PlatformStore> releaseList;

    @TableField(exist = false)
    private HashMap selectData;


    @TableField(exist = false)
    private List<HashMap> selectDataMap;

    @TableField(exist = false)
    private String typeStr;

    private Long memberLevel;

    @TableField(exist = false)
    private String memberLevelName;

}
